﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace CSharpParser.SCharpType
{
    public class CSParameterInfo : ParameterInfo
    {
        private Object _parent;
        private Microsoft.RestrictedUsage.CSharp.Semantics.CSharpParameter _item;

        public CSParameterInfo(object parent, Microsoft.RestrictedUsage.CSharp.Semantics.CSharpParameter item)
        {
            // TODO: Complete member initialization
            this._parent = parent;
            this._item = item;
        }



        //public override object[] GetCustomAttributes(Type attributeType, bool inherit)
        //{
        //    List<Object> l = new List<object>();

        //    foreach (CSharpCustomAttribute item in _item.Attributes)
        //    {
        //        CSharpType t = item.Constructor.ContainingType;
        //        string name1 = t.ContainingNamespace.Name.Text + "." + t.Name.Text;
        //        string name2 = attributeType.FullName;

        //        if (name1 == name2)
        //        {
        //            l.Add(item);
        //        }

        //    }

        //    return l.ToArray();
        //}

        //public override object[] GetCustomAttributes(bool inherit)
        //{
        //    return _item.Attributes.ToArray();
        //}

        //public override bool IsDefined(Type attributeType, bool inherit)
        //{
        //    foreach (CSharpCustomAttribute item in _item.Attributes)
        //    {
        //        CSharpType t = item.Constructor.ContainingType;
        //        string name1 = t.ContainingNamespace.Name.Text + "." + t.Name.Text;
        //        string name2 = attributeType.FullName;

        //        if (name1 == name2)
        //            return false;

        //    }

        //    return false;
        //}

        public override string Name
        {
            get { return _item.Name.Text; }
        }


    }
}
